﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Dsl.Ped.Framework.Projections.CollectionProjections.Vertical"
    xmlns:converters="clr-namespace:Dsl.Ped.Common.Converters;assembly=DSLCommon"
    xmlns:actionBorder="clr-namespace:Dsl.Ped.Controls.ActionBorder;assembly=DSLPedControls">

    <converters:OrientationToDockConverter x:Key="orientationToDockConverter" />
    
    <local:ObjectDataTemplateSelector x:Key="objectDataTemplateSelector"/>
    
    <Style TargetType="{x:Type local:VerticalProjection}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:VerticalProjection}">
                    <ListView Background="{TemplateBinding Background}"
                              BorderThickness="{TemplateBinding BorderThickness}"
                              KeyboardNavigation.IsTabStop="False"
                              x:Name="PART_ItemsListView">
                        <ListView.ItemContainerStyle>
                            <Style TargetType="{x:Type ListViewItem}">
                                <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate>    
                                            <Grid>
                                                <actionBorder:ActionBorderControl Command="{Binding Path=RemoveItemCommand, RelativeSource={RelativeSource AncestorType={x:Type local:VerticalProjection}}}"
                                                                                   CommandParameter="{Binding}">
                                                    <ContentControl ContentTemplateSelector="{StaticResource objectDataTemplateSelector}" Content="{Binding}"/>
                                                </actionBorder:ActionBorderControl>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ListView.ItemContainerStyle>
                    </ListView>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>